<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<script type="text/javascript">
	//html里怎么写,js里就怎么写
		function showHide(){
             var a=document.getElementById("div1");
             if(a.style.display=='block'){
             	a.style.display="none";
             }else{
             	a.style.display="block";
             }
		}
		

	</script>
	<style type="text/css">
        #div1{width:100px;height: 100px;background:#ccc;display: none;}
	</style>
</head>
<body>
	<input type="button" id="text1" value="显示/隐藏" onclick="showHide()">
	<div id="div1"></div>
</body>
</html>